]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell/app: Do not try to activate OR windows
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 26 Jan 2022 15:48:55 +0000 (16:48 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 27 Jan 2022 13:30:49 +0000 (14:30 +0100)
Since https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2029,
we track all windows, including OR ones. While this means that we can
now assume that any window can be matched to an app, it also means
we have to be more careful to not perform an unsupported action like
focus or raise on an OR window.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4973

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2131>

src/shell-app.c

index a3215db59ed4f640769bb1094fb6704df26cf50c..863f4db9d745182409a965be879f53d3708e122f 100644 (file)
@@ -423,8 +423,19 @@ shell_app_activate_window (ShellApp     *app,
     return;
 
   windows = shell_app_get_windows (app);
-  if (window == NULL && windows)
-    window = windows->data;
+  if (window == NULL)
+    {
+      for (GSList *l = windows; l; l = l->next)
+        {
+          MetaWindow *current_window = l->data;
+
+          if (!meta_window_is_override_redirect (current_window))
+            {
+              window = current_window;
+              break;
+            }
+        }
+    }
 
   if (!g_slist_find (windows, window))
     return;
@@ -453,7 +464,9 @@ shell_app_activate_window (ShellApp     *app,
         {
           MetaWindow *other_window = iter->data;
 
-          if (other_window != window && meta_window_get_workspace (other_window) == workspace)
+          if (other_window != window &&
+              !meta_window_is_override_redirect (other_window) &&
+              meta_window_get_workspace (other_window) == workspace)
             meta_window_raise (other_window);
         }
       g_slist_free (windows_reversed);